* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
}

.scroll-container {
  height: 100vh;
  position: relative;
}

.item {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: 1s ease-in-out;
}

.item img {
  position: absolute;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  transition: 1s ease-in-out;
}

.item.prev,
.item.next {
  z-index: 1;
  height: 0;
}

.item.next {
  bottom: 0;
}

.item.next img {
  bottom: 0;
  transform: translateY(10%);
}

.item.prev img {
  transform: translateY(-10%);
}

/* 向上滚动 */
.scroll-up .item.prev {
  height: 100%;
}

/* 向上偏移的视差 */
.scroll-up .item.prev img {
  transform: translateY(0);
}

.scroll-up .item.cur img {
  transform: translateY(10%);
}

/* 向下滚动 */
.scroll-down .item.next {
  height: 100%;
}

/* 向下偏移的视差 */
.scroll-down .item.next img {
  transform: translateY(0);
}

.scroll-down .item.cur img {
  transform: translateY(-10%);
}
